export function localGet (key) {
  const value = window.localStorage.getItem(key)
  try {
    return JSON.parse(window.localStorage.getItem(key))
  } catch (error) {
    return value
  }
}

export function localSet (key, value) {
  window.localStorage.setItem(key, JSON.stringify(value))
}

export function localRemove (key) {
  window.localStorage.removeItem(key)
}

export const pathMap = {
  index: '首页',
  login: '登录',  
  addQuestions: '录入多题',
  addQuestion: '录入单题', 
  square: '题目广场',
  getQuestionsByKnowledgepoint: '知识点',
  getQuestionsBySection: '节',
  getQuestionsByChapter:'章',
  getQuestionsByCourse: '册',
  automaticGroup: '智能组卷',
  searchQuestion: '搜索结果',
}

// 单张图片上传
export const uploadImgServer = 'http://127.0.0.1:8000/api/uploadImage/'
// 多张图片上传
export const uploadImgsServer = 'http://backend-api-02.newbee.ltd/manage-api/v1/upload/files'